﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OC.Common.Entity;
using Portal.Logic;
using System.Collections;

namespace Portal
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                litMsg.Text = "";
            }
        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {

            
            List<UserEntity> list = new UserLogic().GetListByAccount(txtUserName.Value);
            if (list != null && list.Count > 0)
            {
                Session["UserInfo"] = list[0];
                Session["UserName"] = list[0].CN_NAME;//
                Session["UserAccount"] = list[0].AD_ACCOUNT;
                Session["UserDeictionaryList"] = new DectionaryLogic().GetList(txtUserName.Value);
                Response.Redirect("SettingMain.aspx");
            }
            else
            {
                litMsg.Text= "用户名或密码错误！";
                
            }
        }


    }
}